<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
    <meta name="referrer" content="never">
    <title>创建对象的新方法</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        ul {
            list-style: none;
        }
    </style>
</head>
<body>
    
    <script type="text/javascript">
        /* 
        Object.create(prototype) 创建一个对象，对象的原型指向接受的参数对象
        */

        var obj = {
            name: "obj"
        }

        // var user = {
        //     __proto__: obj
        // }

        var user = Object.create(obj);
        console.log(user);
        console.log({ __proto__: obj });
    </script>
</body>
</html>